package 设置线程优先级;
//线程优先级具有继承性，比如A线程启动B线程，则B线程的优先级与A一样

class Mythread1 extends Thread

{
	public void run()
	{
		
		System.out.println(" "+Thread.currentThread().getName());

		System.out.println("MyThread1 run priority="+this.getPriority());
		Mythread2 thread2=new Mythread2();
		thread2.start();
	}
}
class Mythread2 extends Thread{
	public void run()
	{
		System.out.println(" "+Thread.currentThread().getName());

		System.out.println("MyThread2 run priority="+this.getPriority());
	}
	
}
public class Test1_53 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("main thread begin priority="+Thread.currentThread().getName());
		System.out.println("main thread begin priority="+Thread.currentThread().getPriority());
		Thread.currentThread().setPriority(6);
		System.out.println("main thread end priority="+Thread.currentThread().getName());
		System.out.println("main thread end priority="+Thread.currentThread().getPriority());
		Mythread1 thread1=new Mythread1();
		thread1.start();
	}

}
